package org.se.scut.pinterest.mina.utils;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class FormateUtils {

	private static final String dateFormateString = "yyyy-MM-dd hh:mm:ss.mmm";
	
	public static String formateDate(Date date){
		DateFormat format = new SimpleDateFormat(dateFormateString);
		return format.format(date);
	}
	
	public static Date dateFormate(String dateFormate){
		DateFormat format = new SimpleDateFormat(dateFormateString);
		try {
			return format.parse(dateFormate);
		} catch (ParseException e) {
			e.printStackTrace();
		}
		return new Date();
	}
	
}
